﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Collections;

namespace ICeFramework.Common.Configuration
{
    [ConfigurationCollection(typeof(ConnectionElement), CollectionType = ConfigurationElementCollectionType.BasicMap, AddItemName = "connection")]
    public class ConnectionPropertyCollection : ConfigurationElementCollection
    {
        public void Add(ConnectionElement element)
        {
            base.BaseAdd(element);
        }

        protected override ConfigurationElement CreateNewElement()
        {
            return new ConnectionElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((ConnectionElement)element).Name;
        }

        protected override string ElementName
        {
            get { return "connection"; }
        }

        public override ConfigurationElementCollectionType CollectionType
        {
            get { return ConfigurationElementCollectionType.BasicMap; } 
        }

        //public IEnumerator GetEnumerator()
        //{
        //    return base.GetEnumerator();
        //}
    }
   
}
